package com.zjlanyun.eplus;

import android.app.Application;
import android.content.Context;

import com.blankj.utilcode.utils.Utils;
import com.yanzhenjie.nohttp.Logger;
import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.OkHttpNetworkExecutor;

/**
 * Created by lanyun on 16/4/27.
 */
public class MainApplication extends Application {

    private static Context mContext;
    private static Application _instance;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        _instance = this;
        NoHttp.initialize(this, new NoHttp.Config().setNetworkExecutor(new OkHttpNetworkExecutor()));
        Logger.setTag("NoHttp");
        Logger.setDebug(true);

        Utils.init(this);

        Common.checkDeviceToken(getApplicationContext());
    }

    public static Context getContext(){
        return mContext;
    }

    public static Application getInstance() {
        return _instance;
    }
}
